package com.gable.exhibition.dao;

import com.gable.common.util.ReturnResultUtil;
import com.gable.exhibition.model.Upkeep;
import com.gable.exhibition.model.User;
import com.gable.exhibition.view.ParameterView;
import com.gable.exhibition.view.SmsView;
import com.gable.exhibition.view.UpkeepInitServiceView;
import com.gable.exhibition.view.UpkeepView;

import java.util.List;
import java.util.Map;

public interface UpkeepDao {
    int deleteByPrimaryKey(Long upkeepId);

    int insert(Upkeep record);

    int insertSelective(Upkeep record);

    Upkeep selectByPrimaryKey(Long upkeepId);

    int updateByPrimaryKeySelective(Upkeep record);

    int updateByPrimaryKey(Upkeep record);


    /**
     * 获取保养总数 用户分页
     * @param upkeepView
     * @Create user jacky
     * @Create date 2018/2/25
     * @return
     */
    int queryUpkeepCount(UpkeepView upkeepView);

    /**
     * 获取保养列表  分页
     * @param upkeepView
     * @Create user jacky
     * @Create date 2018/2/25
     * @return
     */
    List<UpkeepView> queryUpkeepList(UpkeepView upkeepView);

    /**
     * 根据保养id获取要分配的服务商信息
     * @param upkeepId
     * @Create user jacky
     * @Create date 2018/2/28
     * @return
     */
    UpkeepInitServiceView assignServiceInit(Long upkeepId);


    /**
     * 根据保养id获取保养详情
     * @param upkeepView
     * @Create user jacky
     * @Create date 2018/2/25
     * @return
     */
    UpkeepView queryUpkeepInfo(UpkeepView upkeepView);

    /**
     * 根据维修商id和工程师姓名，带出电话号码
     * @param map
     * @Create user jacky
     * @Create date 2018/3/1
     * @return
     */
    String queryEngineerPhoneByName(Map map);

    /**
     * 查询保养短信需要的信息
     * @param upkeepId
     * @return
     */
    SmsView upkeepForSms(Long upkeepId);

    /**
     * 查询当前设备是否在保养中
     * @param deviceId
     * @Create user jacky
     * @Create date 2018/3/21
     * @return
     */
    int queryDeviceIsUpkeep(Long deviceId);


    int updateUpkeepIdByCopy(Map map);

    /**
     * 保养提醒
     * @param map
     * @Create user jacky
     * @Create date 2018/3/28
     * @return
     */
    List<UpkeepView> remindUpkeepList(Map map);

    List<ParameterView> getMaintainerByHospitalId(ParameterView parameter);


    /**
     * 根据工程师姓名加载电话号码
     * @param map
     * @Create user jacky
     * @Create date 2018/4/9
     * @return
     */
    List<Map> queryPhoneByHospital(Map map);
}